<?php
/**
 * Created by PhpStorm.
 * User: HP
 * Date: 2021/6/9
 * Time: 9:26
 * 曹文娜
 */
namespace app\api\controller\v1;

use app\common\model\Doctor as DoctorModel;

class Doctor extends BaseController
{
    public function doctor()
    {
        $model = new DoctorModel();
        //上部分
        $upper = $model
            ->where('type', 1)
            ->field('id,image,title,desc,content')
            ->select()
            ->toArray();
        $upper = addWebSiteUrl($upper, ['image']);
        //左下
        $left = $model
            ->where('type', 2)
            ->field('id,title,desc,content')
            ->select()
            ->toArray();
        //右下
        $right = $model
            ->where('type', 3)
            ->field('id,image,title,desc,content')
            ->select()
            ->toArray();
        $right = addWebSiteUrl($right, ['image']);
        return sucessMsg(200, '获取成功！',
            [
                'upper' => $upper,
                'left' => $left,
                'right' => $right,
            ]);
    }
}